@functions {
    // To support the layout classification below. Implementing as a razor function because we can, could otherwise be a Func<string[], string, string> in the code block following.
    string CalcuClassify(string[] zoneNames, string classNamePrefix) {
        var zoneCounter = 0;
        var zoneNumsFilled = string.Join("", zoneNames.Select(zoneName => { ++zoneCounter; return Model[zoneName] != null ? zoneCounter.ToString() : "";}).ToArray());
        return HasText(zoneNumsFilled) ? classNamePrefix + zoneNumsFilled : "";
    }
}
@{
    /* Global includes for the theme
    ***************************************************************/
	Style.Include("css/font-awesome.min.css");

    Style.Include("site.css");


    /* Some useful shortcuts or settings
    ***************************************************************/

    Func<dynamic, dynamic> Zone = x => Display(x); // Zone as an alias for Display to help make it obvious when we're displaying zones

	
    /* Last bit of code to prep the layout wrapper
    ***************************************************************/
    
    Model.Id = "layout-wrapper";
    var tag = Tag(Model, "div"); // using Tag so the layout div gets the classes, id and other attributes added to the Model
}	<!-- BindTuning head elements-->
	
	<script type="text/javascript">
		if (typeof jQuery == 'undefined') {document.write('<script type="text/javascript" src="@Href("~/Themes/Terra/js/jquery.min.js")"><' + '/script>');}
		var style_mobile_path = '@Url.Content(Html.ThemePath(WorkContext.CurrentTheme, "/styles/css/"))'; // path for mobile nav css files, ORX-specific
	</script>
	<script type="text/javascript">
		$('head').append('<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">');
	</script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="@Href("~/Themes/Terra/js/html5shiv.js")"></script>
      <script src="@Href("~/Themes/Terra/js/respond.min.js")"></script>
    <![endif]-->
	<script type="text/javascript" src="@Href("~/Themes/Terra/js/bootstrap.min.js")"></script>
<script type="text/javascript" src="@Href("~/Themes/Terra/js/BindMENU.js")"></script>
<script type="text/javascript" src="@Href("~/Themes/Terra/js/fix-responsive-WP8.js")"></script>
<script type="text/javascript" src="@Href("~/Themes/Terra/js/jquery.nivo.slider.pack.js")"></script>


	<!--Apply class to body with browser version-->
	<script type="text/javascript">
		var nVer = navigator.appVersion; var nAgt = navigator.userAgent; var bN = navigator.appName; var fullV = "" + parseFloat(navigator.appVersion); var majorV = parseInt(navigator.appVersion, 10); var nameOffset, verOffset, ix; if ((verOffset = nAgt.indexOf("Opera")) !== -1) { bN = "Opera"; fullV = nAgt.substring(verOffset + 6); if ((verOffset = nAgt.indexOf("Version")) !== -1) { fullV = nAgt.substring(verOffset + 8) } } else { if ((verOffset = nAgt.indexOf("MSIE")) !== -1) { bN = "IE"; fullV = nAgt.substring(verOffset + 5) } else { if ((verOffset = nAgt.indexOf("Chrome")) !== -1) { bN = "Chrome"; fullV = nAgt.substring(verOffset + 7) } else { if ((verOffset = nAgt.indexOf("Safari")) !== -1) { bN = "Safari"; fullV = nAgt.substring(verOffset + 7); if ((verOffset = nAgt.indexOf("Version")) !== -1) { fullV = nAgt.substring(verOffset + 8) } } else { if ((verOffset = nAgt.indexOf("Firefox")) !== -1) { bN = "Firefox"; fullV = nAgt.substring(verOffset + 8) } else { if ((nameOffset = nAgt.lastIndexOf(" ") + 1) < (verOffset = nAgt.lastIndexOf("/"))) { bN = nAgt.substring(nameOffset, verOffset); fullV = nAgt.substring(verOffset + 1); if (bN.toLowerCase() == bN.toUpperCase()) { bN = navigator.appName } } } } } } } if ((ix = fullV.indexOf(";")) !== -1) { fullV = fullV.substring(0, ix) } if ((ix = fullV.indexOf(" ")) !== -1) { fullV = fullV.substring(0, ix) } majorV = parseInt("" + fullV, 10); if (isNaN(majorV)) { fullV = "" + parseFloat(navigator.appVersion); majorV = parseInt(navigator.appVersion, 10) } 
		document.getElementsByTagName("body")[0].className += " " +  bN + " " +  bN + majorV + " cmsORX cmsORX1 BT-pk";
	</script>

<script type="text/javascript">
	(function( $ ) {
		$('head').append('<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Oswald:400,300,700">');
		$('head').append('<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900">');
	})(jQuery);
</script>

<header class="navbar">
	<div class="header-aux">
		<div class="container">
			<div class="row">
				<button data-toggle="collapse" class="navbar-toggle" type="button" data-target=".collapse-user"><i class="fa fa-user"></i></button>
				<button data-toggle="collapse" class="navbar-toggle" type="button" data-target=".collapse-search"><i class="fa fa-search"></i></button>
				<button data-toggle="collapse" class="navbar-toggle pull-right" type="button" data-target=".collapse-nav"><i class="fa fa-bars"></i></button>
				<div class="clearfix visible-xs visible-sm"></div>

				<div class="col-sm-8">
					<div class="navbar-collapse collapse collapse-user">
						<span id="Language"></span>
						<span id="Login">@if (Request.IsAuthenticated) {
		<span class="user-actions">
			@Html.ActionLink(T("Sign Out").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })
			@Html.ActionLink("Dashboard", "Index", new { Area = "Dashboard", Controller = "Admin" })
		</span>
} else {
		<span class="user-actions">@Html.ActionLink(T("Sign In").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })</span>
}</span>
						<span id="User">@if (Request.IsAuthenticated) {
	<span class="welcome">@if(WorkContext.CurrentUser != null){@T("<strong>{0}</strong>", new HtmlString(Html.ActionLink( WorkContext.CurrentUser.UserName, "ChangePassword", new { Controller = "Account", Area = "Orchard.Users" }).ToString()))}</span>
}</span>
					</div>
				</div>
				<div class="col-sm-4 pull-right">
					<div class="navbar-collapse collapse collapse-search">
						<div class="btn hidden-xs" data-toggle="button"></div>
						<div id="Search" class="container"><div id="SearchBar">@using (Html.BeginForm("index", "search", new { area = "Orchard.Search" }, FormMethod.Get, new { @class = "search-form" })){<fieldset><input type="text" value="" name="q" id="q"><button type="submit"></button></fieldset>}</div></div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="header-main">
		<div class="container">
			<div class="row">
				<div class="col-md-3" id="Logo"><h1><a href="~/" title="Go to Home">@WorkContext.CurrentSite.SiteName</a></h1></div>
				<div class="navbar-collapse collapse collapse-nav">
					<div class="col-md-9">
						<nav><div id="MenuH">@if (Model.Navigation != null) {@Display(Model.Navigation)}</div></nav>
					</div>
				</div>
			</div>
		</div>
	</div>
</header>

<div id="HomeSlider">@if (Model.Header != null){<div id="Header">@Display(Model.Header)</div>}</div>

<div id="MainWrapper" class="boxed">



	<div class="container">
		<div id="Main" role="main"><div class="row">
	@if (Model.BeforeMain != null){<div class="col-md-12" runat="server" id="BeforeMain">@Display(Model.BeforeMain)</div>}
</div>
<div class="row">
	@if (Model.BeforeContent != null){<div class="col-md-7" runat="server" id="BeforeContent">@Display(Model.BeforeContent)</div>}
	@if (Model.AsideFirst != null){<div class="col-md-5" runat="server" id="AsideFirst">@Display(Model.AsideFirst)</div>}
</div>
<div class="row">
	
	
</div>
<div class="row">
	
	
</div>
<div class="row">
	@if (Model.Content != null){<div class="col-md-12" runat="server" id="Content">@Display(Model.Content)</div>}
</div>
<div class="row">
	
	
</div>
<div class="row">
	@if (Model.AsideSecond != null){<div class="col-md-4" runat="server" id="AsideSecond">@Display(Model.AsideSecond)</div>}
	@if (Model.AfterContent != null){<div class="col-md-8" runat="server" id="AfterContent">@Display(Model.AfterContent)</div>}
</div>
<div class="row">
	
	
	
</div>
<div class="row">
	@if (Model.AfterMain != null){<div class="col-md-12" runat="server" id="AfterMain">@Display(Model.AfterMain)</div>}
</div>
<div class="row">
	@if (Model.TripelFirst != null){<div class="col-md-4" runat="server" id="TripelFirst">@Display(Model.TripelFirst)</div>}
	@if (Model.TripelSecond != null){<div class="col-md-4" runat="server" id="TripelSecond">@Display(Model.TripelSecond)</div>}
	@if (Model.TripelThird != null){<div class="col-md-4" runat="server" id="TripelThird">@Display(Model.TripelThird)</div>}
</div></div>
	</div>



	<footer>
		<div class="container">
			<div id="FooterWidgets">
				<div class="row">
					<div class="col-md-3">@if (Model.FooterQuadFirst != null){<div id="FooterQuadFirst">@Display(Model.FooterQuadFirst)</div>}</div>
					<div class="col-md-3">@if (Model.FooterQuadSecond != null){<div id="FooterQuadSecond">@Display(Model.FooterQuadSecond)</div>}</div>
					<div class="col-md-3">@if (Model.FooterQuadThird != null){<div id="FooterQuadThird">@Display(Model.FooterQuadThird)</div>}</div>
					<div class="col-md-3">@if (Model.FooterQuadFourth != null){<div id="FooterQuadFourth">@Display(Model.FooterQuadFourth)</div>}</div>
				</div>
				<div class="row">
					<div class="col-md-4"></div>
					<div class="col-md-4"></div>
					<div class="col-md-4"></div>
				</div>
				<div class="row">
					<div class="col-md-6"></div>
					<div class="col-md-6"></div>
				</div>
				<div class="row">
					<div class="col-md-12">@if (Model.Footer != null){<div id="Footer">@Display(Model.Footer)</div>}</div>
				</div>
			</div><!-- End Footer Widgets-->
		</div>
		<div class="container">
			<div id="FooterCopyright">
				<span id="Copyright"><span class="Copyright">&copy; 2014 @WorkContext.CurrentSite.SiteName. All rights reserved.</span></span>
				<span id="Sitemap"></span>
				<span id="Privacy"></span>
				<span id="Terms"></span>
				<span id="Cart"></span>
			</div>
		</div>
	</footer>
</div>

<div id="BgLayer1"></div>

<script type="text/javascript">
	(function ($) {
		$(window).load(function () {
			$('body').css('padding-top',$('header').outerHeight(true));
			$('#MainWrapper > .container').css('padding-bottom',$('footer').outerHeight(true) + 40 + 'px');
		});
	})(jQuery);
</script>
	
<script type="text/javascript">
		(function ($) {
			$(document).ready(function () {
				//Nivo Slider
				$('#slider').nivoSlider({
					effect:'random'
				});

				//Tooltips
				$('*[data-toggle=tooltip]').tooltip();

				//Popovers
				$('*[data-toggle=popover]').popover({
					trigger: 'hover'
				});

				//MoveSlider
				if(typeof g_disableCheckoutInEditMode != 'undefined' && !g_disableCheckoutInEditMode) {
					$('.MoveToSliderZone').appendTo('#HomeSlider');
				}
			});
		})(jQuery);
</script>

<!--[if lte IE 8]>
	<script type="text/javascript" src="@Href("~/Themes/Terra/js/fix-search-ie8.js")"></script>
<![endif]-->

	<script type="text/javascript" >
	(function( $ ) {
		$("#MenuH .menu").BindMENU({ MenuStyle: "DefaultMenu", Orientation: "Horizontal" });
		$("#MenuV .menu").BindMENU({ MenuStyle: "DefaultMenu", Orientation: "Vertical" });
	})(jQuery);
	</script>
	<!-- powered by BIND TUNING 2014 // http://www.bindtuning.com -->
